#ifndef __GL_UI_H__
#define __GL_UI_H__

#include <GL/gl.h>
#include <TTFFont.h>

#ifndef WIDTH
#define WIDTH 640
#endif

#ifndef HEIGHT
#define HEIGHT 480
#endif

//this font will be used by all of the controls
extern TTFFont *g_GLuiFont;
extern Texture *g_GLuiCursorTex;

namespace GLui
{
    void drawCursor(int x, int y, GLuint texid);
}

class GLRect{
    static const int NumVerts = 32; //defines the number of vertices. 
    int x;
    int y;
    int w;
    int h;
    int r;
    float col[4]; //color information
    float *_v;

    //generate the co-ordinates for drawing rounded rect.
    void genRectCoords();

    public:
        GLRect(int x, int y, int w, int h, int r = 5);
        ~GLRect();
        //inline functions
        int getWidth(){return w;}
        int getHeight(){return h;}
        int getX(){return x;}
        int getY(){return y;}

        //move the rect to a new location
        void move(int x, int y);
        //renders the rectangle
        void draw();
        //specify color
        void setColor(int r, int g, int b, int a =255);
        //check if a certain point is inside rectangle or not
        bool isPointOver(int x, int y);
};
#endif //__GL_UI_H__
